def parse_cookies(cookie_string):
    cookies = {}
    if cookie_string:
        # 使用分号分割字符串
        cookie_parts = cookie_string.split(';')

        # 遍历每个cookie部分
        for part in cookie_parts:
            # 去除前后的空格，并使用等号分割名称和值
            part = part.strip()
            if '=' in part:
                key, value = part.split('=', 1)
                cookies[key] = value
    return cookies


def getCookie():
    # 示例cookie字符串
    cookie_str = "BIDUPSID=473E3B8838D9469EA22326F6AC6B18D8; PSTM=1719220932; BAIDUID=473E3B8838D9469E6294EB59149C2F77:FG=1; BD_HOME=1; BD_UPN=12314753; BA_HECTOR=2h012105a08ha4ag0k0h8ka03c9j0d1j7iem51u; BAIDUID_BFESS=473E3B8838D9469E6294EB59149C2F77:FG=1; ZFY=2N10hgbU:A2wNMlq:A:BxpiSm707PEe:AzpfjhirzNShlto:C; BDUSS=UN0eXVGb2pOcmZEdnZxbndJTTVvZ3kwaWVtZm1rZC1EeVdlOGNrMndvSUF5YUJtSUFBQUFBJCQAAAAAAQAAAAEAAADv5fR7bGl1bGFucWlfbWpBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8eWYAPHlmd; BDUSS_BFESS=UN0eXVGb2pOcmZEdnZxbndJTTVvZ3kwaWVtZm1rZC1EeVdlOGNrMndvSUF5YUJtSUFBQUFBJCQAAAAAAQAAAAEAAADv5fR7bGl1bGFucWlfbWpBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8eWYAPHlmd; H_PS_PSSID=60339_60346_60351_60367"
    # 调用函数转换为字典
    return parse_cookies(cookie_str)
